summaryrefslogtreecommitdiff
path: root/src/pages/api/auth/[...nextauth].js
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-06-18 10:26:17 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-06-18 10:26:17 +0700
commit4d849f1ab72a0d0eb5851662f200ccef21b66457 (patch)
tree45e7f6fd3dbdc4e24513081e9a0f2e682bbc3966 /src/pages/api/auth/[...nextauth].js
parentb7c98bf3586d31fa65eea048ed2c98db321ce28c (diff)
fixing error sign in and sign out google
Diffstat (limited to 'src/pages/api/auth/[...nextauth].js')
-rw-r--r--src/pages/api/auth/[...nextauth].js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pages/api/auth/[...nextauth].js b/src/pages/api/auth/[...nextauth].js
index 3c433167..c188aaa1 100644
--- a/src/pages/api/auth/[...nextauth].js
+++ b/src/pages/api/auth/[...nextauth].js
@@ -20,7 +20,11 @@ export default NextAuth({
session.accessToken = token.accessToken
return session
- }
+ },
+ async redirect({ url, baseUrl }) {
+ // Redirect to dashboard after login
+ return url.startsWith(baseUrl) ? url : baseUrl;
+ },
},
secret: process.env.JWT_SECRET
})